var id= getUrlParam('id');
console.log(id)
//获取url中的参数
function getUrlParam(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
    var r = window.location.search.substr(1).match(reg);  //匹配目标参数
    if (r != null) return unescape(r[2]); return null; //返回参数值
}
var vm = new Vue({
    el:"#ljw1",
    data:{
        name:"",
        contact:"",
        phone:"",
        address:"",
        dHouse:"",
        remark:"",
        adminname:'',



    },
    mounted(){
        axios({
            url:"/purchase/showSp",
            params:{
                id:id
            },
            method:"post"
        }).then(response=>{
            console.log(response)
            vm.name = response.data.obj.name
            vm.contact=response.data.obj.contact
            vm.phone=response.data.obj.phone
            vm.address=response.data.obj.address
            vm.dHouse=response.data.obj.dHouse
            vm.remark=response.data.obj.remark
        });
        var ca = document.cookie.split(';')[0];
        var bb=ca.toString().substring(ca.indexOf("|")+1);
        this.adminname=bb;
        // alert(bb);
    }
})